package cn.yunhe.service;

import cn.yunhe.dao.NewsDao;
import cn.yunhe.entity.News;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

public class NewsService  {
    SqlSession session =SqlSessionFactoryUtil.getSqlSession();
    NewsDao newsDao =session.getMapper(NewsDao.class);

    public boolean addNews(News news){
        boolean flag=newsDao.addNews(news);
        session.commit();
        return flag;
    }
}
